package com.mlog.njyjy.ndop.share.sql.annotation;

import com.mlog.njyjy.ndop.share.sql.support.JoinFetchType;

import java.lang.annotation.*;

/**
 * <p>
 * - 仅支持查询
 * - 仅支持 1:1 1:N
 * - 不支持中间表模式
 * </p>
 *
 * @author <a href="mailto:yingxiufeng@mlogcn.com">alex</a>
 * @version v1.0, 2020/8/11
 */
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Join {

    /**
     * TBD
     * @return
     */
    JoinFetchType fetchType() default JoinFetchType.eager;

    /**
     * 当前表关联字段
     *
     * @return
     */
    String joinedBy();

    /**
     * 关联表映射字段
     *
     * @return
     */
    String mappedBy();

}
